package com.dyc.caradvertisting.widget.trView;


import android.content.Context;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.dyc.caradvertisting.R;
import com.njh.tools.base.BaseViewHolder;


public class CommFooterVH extends BaseViewHolder<Object> {
    public ProgressBar progressbar;
    public TextView tv_state;
    public static int LAYOUT_TYPE = R.layout.list_footer_view;

    public CommFooterVH(Context context, View v) {
        super(v);
    }

    public CommFooterVH(View v) {
        super(v);
    }

    @Override
    public int getType() {
        return LAYOUT_TYPE;
    }

    @Override
    public void onBindViewHolder(View view, Object o) {
        boolean isHasMore = (null == o ? false : true);
        // TODO: 16/8/5 为何报空指针?
        try {
            progressbar=(ProgressBar)view.findViewById(R.id.progressbar);
            tv_state =(TextView) view.findViewById(R.id.tv_state);
            progressbar.setVisibility(isHasMore ? View.VISIBLE : View.GONE);
            tv_state.setVisibility(isHasMore ? View.VISIBLE : View.GONE);
            tv_state.setText(isHasMore ? "正在加载" : "");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}